package com.libmessagecenter

import android.content.Context
import android.content.Intent
import com.libbase.utils.JsonUtils
import com.libmessagecenter.models.Message

interface PushSDKInterface {
    fun register(context: Context, appId: String?, appKey: String?)

    fun handleIntent(intent: Intent): Boolean {
        return intent.extras?.getString("appMessage")?.let {
            val message = JsonUtils.json.fromJson(it, Message::class.java)
            LibMessageCenter.instance.onMessageDidReceive(message)

            true
        } ?: false
    }
}